package com.bootdo.lgs.order.dao;

import com.bootdo.lgs.order.model.LgsNotice;
import com.bootdo.lgs.order.model.LgsOrder;
import com.bootdo.lgs.order.model.LgsOrderQuery;
import com.bootdo.lgs.order.model.OrderExcel;
import org.apache.ibatis.annotations.Insert;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper {

	List<LgsOrder> getList(LgsOrderQuery condition);

	List<LgsOrder> getExportList(LgsOrderQuery condition);

	int add(LgsOrder condition);

	int insertBatch(OrderExcel condition);

	LgsOrder getDataById(Long id);

	int update(LgsOrder condition);

	List getLgsOrdersByIds(List<Long> ids);

	int addComment(LgsOrder condition);

	int delete(Long id);

	//通过时间获取当天运单号的后3位字符串
	String getLast3ByDateStr(String condition);

	List<LgsNotice> getLgsNotices(List<LgsOrder> list);

    int batchUpdate(List<LgsOrder> list);

	@Insert("insert into his_order_change (order_id, customer_name, consignee, consignee_phone, consignee_address, update_date) VALUES (#{id}, #{customer_name}, #{consignee}, #{consignee_phone}, #{consignee_address}, #{update_date})")
	int addHisRecord(LgsOrder order);

	//查询自动绑定单号失败订单
	List<LgsOrder> getFailLgsOrder();

}
